package com.ziqikeji.adapter.inherit;

import com.ziqikeji.adapter.Voltage220;
import com.ziqikeji.adapter.Voltage5;

/**
 * 对象适配器
 * 不常用，因为Java只能单一继承
 * Created by FlyFive on 2018/5/23.
 */
public class VoltageAdapter extends Voltage220 implements Voltage5 {
    @Override
    public int output5V() {
        int src = output220V();
        System.out.println("适配器工作开始适配电压");
        int dst = src / 44;
        System.out.println("适配完成后输出电压：" + dst);
        return dst;
    }
}
